SwitchBox = new function(){
	var anInt = -1;
	var curImg;
	this.init = function(){
		curImg = $("#switch-1");
		anInt = setInterval(function(){
			curImg.hide(1000);
			curImg = _nextImg();
			curImg.show(1000);
		},4000);
		
		_sliderChoose();
	};
	
	function _sliderChoose(){		
		$("#switch-controller .switch-controller-left").hover(
			function(){			
				$(this).addClass("activeleft");
			},
			function(){
				$(this).removeClass("activeleft");
			}
		);
		$("#switch-controller .switch-controller-left").bind({
			"mouseenter":
			function(){			
				$(this).addClass("activeleft");
			},
			"mouseleave":
			function(){
				$(this).removeClass("activeleft");
			},
			"click":
			function(){
				curImg.hide();
				curImg = _preImg();
				curImg.show();
			}
		});
		$("#switch-controller .switch-controller-right").bind({
			"mouseenter":
			function(){
				$(this).addClass("activeright");
			},
			"mouseleave":
			function(){
				$(this).removeClass("activeright");
			},
			"click":
			function(){
				curImg.hide();
				curImg = _nextImg();
				curImg.show();
			}
		});
	}
	
	function _nextImg(){
		if(curImg.attr("id")=="switch-6"){
			return $("#switch-1");
		}else{
			return curImg.next();
		}
	}
	function _preImg(){
		if(curImg.attr("id")=="switch-1"){
			return $("#switch-6");
		}else{
			return curImg.prev();
		}
	}
}();

var IndexNav = new function(){
	var curItem;
	this.init = function(){
		curItem = $("#index-center-xianlu");
		_nav();
	};
	
	function _nav(){
		$("#index-center a").each(function(){
			var $this = $(this);
			$this.mouseenter(function(){
				if($this!=curItem){
					$this.addClass("active");
				}				
			});
			$this.mouseleave(function(){
				if($this!=curItem){
					$this.removeClass("active");
				}			
			});
			$this.click(function(){
				curItem.removeClass("active");
				$this.addClass("active");
				curItem = $this;
				_chooseItem(curItem);
			});
		});	 
	}
	function _chooseItem($obj){
		var id = $obj.attr("id");
		if(id==="index-center-xianlu"){
			_chooseXianlu();
		}else if(id==="index-center-map"){
			_chooseMap();
		}else if(id==="index-center-culture"){
			_chooseCulture();
		}else if(id==="index-center-zhuangbei"){
			_chooseZhuangbei();
		}else if(id==="index-center-insurance"){
			_chooseInsurance();
		}else if(id==="index-center-hotel"){
			_chooseHotel();
		}
	}
	function _chooseXianlu(){
		
	}
	function _chooseMap(){
		
	}
	function _chooseCulture(){
		
	}
	function _chooseZhuangbei(){
		
	}
	function _chooseInsurance(){
		
	}
	function _chooseHotel(){
		
	}
	
}();